<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>等级显示</title>
    <script src="./vue.js"></script>
</head>
<body>
    <div id="app"> 
        请输入张三的考试成绩: <input type="text" v-model="msg" @input="a">
        <h1>{{str}}</h1>
    </div>
    <script>
       new Vue({
            el:"#app",
            data:{
                msg:"",
                str:"没有成绩"
            },
            methods: {
                a(){
                    if(this.msg>90){
                        this.str="成绩优秀"
                    }
                    else if(this.msg>75){
                        this.str="成绩良好"
                    }
                    else if(this.msg>60){
                        this.str="成绩及格"
                    }
                    else {
                        this.str="成绩不及格"
                    }
                     console.log(this.msg)
                }
                
            },
        })
    </script>
</body>
</html>